﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Progetto
{
    public class Place
    {
        public Place() {
            placeName = "";
            timeOfStay = new TimeSpan(0, 0, 0);
            networkList = new Dictionary<string, UInt32>();
            actionList = new List<string>();
        }
        public Place(string name)
        {
            placeName = name;
            timeOfStay = new TimeSpan(0, 0, 0);
            networkList = new Dictionary<string, UInt32>();
            actionList = new List<string>();
        }

        // the name of the place (defined and modifiable by the user)
        private string placeName;

        // the interval of time during which an user stays in the place
        private TimeSpan timeOfStay;

        // the network list associated to the place
        private Dictionary<string, UInt32> networkList;

        // the list of actions defined by the user
        private List<string> actionList;

        // SETTER METHODS
        public void setPlaceName(string name) {
            placeName = name;
        }
        public void setNetworkList(Dictionary<string, UInt32> newList) {
            networkList = new Dictionary<string, UInt32>(newList);
        }
        public void setTimeOfStay(TimeSpan ts) {
            timeOfStay = new TimeSpan(ts.Hours, ts.Minutes, ts.Seconds);
        }
        public void upgradeTimeofStay() {
            int hours = timeOfStay.Hours;
            int minutes = timeOfStay.Minutes;
            int seconds = timeOfStay.Seconds;
            seconds++;
            timeOfStay = new TimeSpan(hours, minutes, seconds);
        }
        public void setActionList(string actionName) {
            actionList.Add(actionName);
        }
        public void setAList(List<string> aList) {
            actionList = new List<string>(aList);
        }

        // GETTER METHODS
        public string getPlaceName() { return placeName; }
        public TimeSpan getTimeOfStay() { return timeOfStay; }
        public Dictionary<string, UInt32> getNetworkList() { return networkList; }
        public List<string> getActionList() { return actionList; }

    }
}